//
//  DetailAuthorIntroduceCell.m
//  ShangHaiTuJI
//
//  Created by xiaoxiangtuji on 2017/9/1.
//  Copyright © 2017年 xiaoxiangtuji. All rights reserved.
//

#import "DetailAuthorIntroduceCell.h"

@implementation DetailAuthorIntroduceCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setSubviews];
    }
    return self;
}

-(void)setSubviews{
    self.iconImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.iconImageView];
    [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(scaleLeftAndRight(10));
        make.top.equalTo(self.contentView.mas_top).offset(scaleTopAndBottom(5));
        make.size.mas_equalTo(CGSizeMake(50, 50));
    }];
    self.nameLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.nameLabel];
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.iconImageView.mas_right).offset(scaleLeftAndRight(5));
        make.top.equalTo(self.contentView.mas_top).offset(scaleTopAndBottom(5));
        make.size.mas_equalTo(CGSizeMake(scaleLeftAndRight(240), scaleTopAndBottom(20)));
    }];
    self.attentionLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.attentionLabel];
    [self.attentionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.iconImageView.mas_right).offset(scaleLeftAndRight(5));
        make.top.equalTo(self.nameLabel.mas_bottom).offset(scaleTopAndBottom(5));
        make.size.mas_equalTo(CGSizeMake(scaleLeftAndRight(120), scaleTopAndBottom(15)));
    }];
    self.fanslabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.fanslabel];
    [self.fanslabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.attentionLabel.mas_right);
        make.top.equalTo(self.nameLabel.mas_bottom).offset(scaleTopAndBottom(5));
        make.size.mas_equalTo(CGSizeMake(scaleLeftAndRight(120), scaleTopAndBottom(15)));
    }];
    self.descripLabel = [[UILabel alloc] init];
    self.descripLabel.numberOfLines = 0;
    [self.contentView addSubview:self.descripLabel];
    [self.descripLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(scaleLeftAndRight(10));
        make.top.equalTo(self.iconImageView.mas_bottom).offset(scaleTopAndBottom(10));
        make.right.equalTo(self.contentView.mas_right).offset(scaleLeftAndRight(-10));
        make.bottom.equalTo(self.contentView.mas_bottom).offset(scaleTopAndBottom(-5));
    }];
    self.addAttentionBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.contentView addSubview:self.addAttentionBtn];
    [self.addAttentionBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(25, 45));
        make.top.equalTo(self.contentView.mas_top).offset(scaleTopAndBottom(5));
        make.right.equalTo(self.contentView.mas_right).offset(scaleLeftAndRight(-10));
    }];
    self.nameLabel.backgroundColor = [UIColor redColor];
    self.iconImageView.backgroundColor = [UIColor greenColor];
    self.addAttentionBtn.backgroundColor = [UIColor greenColor];
    self.descripLabel.backgroundColor = [UIColor orangeColor];
    self.attentionLabel.text = @"700关注";
    self.fanslabel.text = @"8亿粉丝";
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
